/* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 加载状态指示器 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    transition: opacity 0.5s ease-out;
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-content {
    text-align: center;
    color: white;
    max-width: 300px;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 15px;
}

.loading-progress {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-bar {
    height: 100%;
    background: white;
    border-radius: 2px;
    transition: width 0.3s ease;
    width: 0%;
}

.loading-details {
    font-size: 14px;
    opacity: 0.8;
    min-height: 20px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    overflow: hidden;
    user-select: none;
}

/* 标题栏 */
.title-bar {
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    -webkit-app-region: drag;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.title-bar-left {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    font-size: 14px;
    font-weight: 500;
}

.title-bar-left i {
    font-size: 16px;
}

.title-bar-right {
    display: flex;
    gap: 4px;
    -webkit-app-region: no-drag;
}

.title-btn {
    width: 32px;
    height: 24px;
    border: none;
    background: transparent;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.title-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.title-btn.close:hover {
    background: #e74c3c;
}

/* 主容器 */
.app-container {
    display: flex;
    height: calc(100vh - 32px);
}

/* 侧边栏 */
.sidebar {
    width: 300px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-right: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

/* 用户信息 */
.user-info {
    padding: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    cursor: pointer;
    transition: transform 0.2s;
}

.user-avatar:hover {
    transform: scale(1.05);
}

.user-details {
    flex: 1;
}

.user-nickname {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.user-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #666;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #27ae60;
}

.status-indicator.offline {
    background: #95a5a6;
}

.user-actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.action-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: #666;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.action-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 侧边栏操作 */
.sidebar-actions {
    padding: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.primary-btn {
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.2s;
}

.primary-btn:hover {
    transform: translateY(-1px);
}

.primary-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.secondary-btn {
    padding: 10px 16px;
    border: 1px solid #ddd;
    background: white;
    color: #666;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.secondary-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

/* 好友列表 */
.friends-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.section-header {
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.section-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.count {
    background: #667eea;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.friends-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.friend-item {
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
}

.friend-item:hover {
    background: rgba(102, 126, 234, 0.1);
}

.friend-item.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.friend-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
}

.friend-item.active .friend-avatar {
    background: rgba(255, 255, 255, 0.2);
}

.friend-info {
    flex: 1;
}

.friend-name {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 2px;
}

.friend-status {
    font-size: 12px;
    opacity: 0.7;
    display: flex;
    align-items: center;
    gap: 6px;
}

.friend-version {
    font-size: 11px;
    opacity: 0.6;
    margin-top: 2px;
    font-style: italic;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    margin-bottom: 8px;
    font-size: 14px;
}

/* 主聊天区域 */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
}

/* 聊天头部 */
.chat-header {
    height: 70px;
    padding: 0 24px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.5);
}

.chat-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
}

.chat-user-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 2px;
}

.chat-user-status {
    font-size: 12px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 4px;
}

.chat-user-version {
    font-size: 11px;
    color: #888;
    margin-top: 2px;
    font-style: italic;
}

.chat-actions {
    display: flex;
    gap: 8px;
}

/* 聊天消息区域 */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.welcome-message {
    text-align: center;
    padding: 60px 40px;
    color: #666;
}

.welcome-icon {
    font-size: 64px;
    margin-bottom: 24px;
    opacity: 0.3;
}

.welcome-message h2 {
    font-size: 24px;
    margin-bottom: 16px;
    color: #333;
}

.welcome-message p {
    margin-bottom: 8px;
    font-size: 16px;
    line-height: 1.5;
}

.welcome-actions {
    margin-top: 32px;
}

.usage-tips {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin: 24px 0;
    text-align: left;
    max-width: 600px;
}

.usage-tips h3 {
    color: #495057;
    font-size: 18px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.usage-tips h3 i {
    color: #ffc107;
}

.usage-tips ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.usage-tips li {
    margin-bottom: 12px;
    padding-left: 20px;
    position: relative;
    line-height: 1.6;
    color: #495057;
}

.usage-tips li:before {
    content: '•';
    color: #007bff;
    font-weight: bold;
    position: absolute;
    left: 0;
}

.usage-tips strong {
    color: #212529;
}

/* 消息样式 */
.message {
    max-width: 70%;
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
}

.message.sent {
    align-self: flex-end;
    align-items: flex-end;
}

.message.received {
    align-self: flex-start;
    align-items: flex-start;
}

.message-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    font-size: 12px;
    color: #666;
}

.message.sent .message-header {
    flex-direction: row-reverse;
}

.message-content {
    background: white;
    padding: 12px 16px;
    border-radius: 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    word-wrap: break-word;
    position: relative;
}

.message.sent .message-content {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.message.received .message-content {
    background: #f8f9fa;
    color: #333;
}

.message-text {
    font-size: 14px;
    line-height: 1.4;
    white-space: pre-wrap;
}

.message-time {
    font-size: 11px;
    opacity: 0.7;
    margin-top: 4px;
}

/* 文件消息样式 */
.file-message {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
    border-radius: 16px;
    border: 1px solid rgba(102, 126, 234, 0.15);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.file-message::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}

.file-message:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.15);
    border-color: rgba(102, 126, 234, 0.3);
}

.file-message i {
    font-size: 32px;
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
    padding: 12px;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.file-message:hover i {
    background: rgba(102, 126, 234, 0.2);
    transform: scale(1.05);
}

.file-info {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-size: 15px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

.file-size {
    font-size: 13px;
    color: #718096;
    font-weight: 500;
}

.file-download {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.file-download i {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.file-download:hover i {
    transform: translateY(-1px);
}

.file-download::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.file-download:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
}

.file-download:hover::before {
    left: 100%;
}

.file-download:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
}

/* 文件传输状态样式 */
.file-message.sending {
    opacity: 0.7;
    pointer-events: none;
}

.file-message.sending::after {
    content: '发送中...';
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    background: rgba(102, 126, 234, 0.9);
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .file-message {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .file-download {
        align-self: stretch;
        justify-content: center;
    }
    
    .file-name {
        font-size: 14px;
    }
    
    .file-size {
        font-size: 12px;
    }
}

/* 文件类型特殊样式 */
.file-message[data-file-type="image"] {
    border-left: 4px solid #48bb78;
}

.file-message[data-file-type="video"] {
    border-left: 4px solid #ed64a6;
}

.file-message[data-file-type="audio"] {
    border-left: 4px solid #9f7aea;
}

.file-message[data-file-type="document"] {
    border-left: 4px solid #2b6cb0;
}

.file-message[data-file-type="archive"] {
    border-left: 4px solid #805ad5;
}

.file-message[data-file-type="code"] {
    border-left: 4px solid #319795;
}

/* 图片消息样式 */
.image-message {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 100%;
}

.image-preview {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(102, 126, 234, 0.05);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.image-preview img {
    max-width: 300px;
    max-height: 200px;
    width: auto;
    height: auto;
    display: block;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 12px;
}

.image-preview img:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.image-preview img.fullscreen {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 90vw;
    max-height: 90vh;
    z-index: 10001;
    background: white;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    cursor: zoom-out;
}

/* 全屏图片背景遮罩 */
.image-preview img.fullscreen + .fullscreen-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.image-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: #718096;
    background: rgba(113, 128, 150, 0.1);
    border-radius: 12px;
    min-height: 120px;
}

.image-error i {
    font-size: 32px;
    margin-bottom: 8px;
    opacity: 0.6;
}

.image-error span {
    font-size: 14px;
    font-weight: 500;
}

.image-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 10px;
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.image-info .file-info {
    flex: 1;
    min-width: 0;
}

.image-info .file-name {
    font-size: 14px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.image-info .file-size {
    font-size: 12px;
    color: #718096;
    font-weight: 500;
}

.image-info .file-download {
    padding: 8px 16px;
    font-size: 12px;
    white-space: nowrap;
}

/* 响应式图片消息 */
@media (max-width: 768px) {
    .image-preview img {
        max-width: 250px;
        max-height: 150px;
    }
    
    .image-info {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .image-info .file-download {
        align-self: center;
    }
}

/* 消息输入区域 */
.message-input-area {
    padding: 20px 24px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.5);
}

.input-container {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    background: white;
    border-radius: 24px;
    padding: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

.input-action-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: #666;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.input-action-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.input-action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#message-input {
    flex: 1;
    border: none;
    outline: none;
    resize: none;
    font-size: 14px;
    line-height: 1.4;
    padding: 8px 12px;
    max-height: 200px;
    min-height: 40px;
    height: 40px;
    font-family: inherit;
    overflow-y: hidden;
    transition: height 0.2s ease;
}

.send-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.send-btn:hover {
    transform: scale(1.05);
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* 模态框样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

/* 最近连接样式 */
.recent-connections {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.recent-connections h4 {
    margin: 0 0 10px 0;
    color: #495057;
    font-size: 14px;
    font-weight: 600;
}

.recent-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.recent-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.recent-item:hover {
    background: #e3f2fd;
    border-color: #2196f3;
    transform: translateY(-1px);
}

.recent-item-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.recent-item-name {
    font-weight: 600;
    color: #212529;
    font-size: 14px;
}

.recent-item-ip {
    color: #6c757d;
    font-size: 12px;
    margin-top: 2px;
}

.recent-item-time {
    color: #adb5bd;
    font-size: 11px;
    white-space: nowrap;
}

.recent-item-select {
    background: #2196f3;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.recent-item-select:hover {
    background: #1976d2;
}

/* 本地信息显示 */
.local-info {
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    border: 1px solid #e1bee7;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.local-info p {
    margin: 5px 0;
    font-size: 14px;
}

.local-info .tip {
    color: #666;
    font-style: italic;
    font-size: 12px;
    margin-top: 10px;
}

.local-info strong {
    color: #7b1fa2;
}

.local-info span {
    font-weight: bold;
    color: #4a148c;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.close-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: #666;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.close-btn:hover {
    background: #f5f5f5;
    color: #333;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.form-group small {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #666;
}

/* 头像选择 */
.avatar-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    padding: 16px 0;
}

.avatar-option {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    cursor: pointer;
    transition: transform 0.2s;
    margin: 0 auto;
}

.avatar-option:hover {
    transform: scale(1.1);
}

.avatar-option.selected {
    transform: scale(1.1);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
}

/* 服务器状态 */
.server-status {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 16px;
    margin-top: 16px;
}

.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 14px;
}

.status-item:last-child {
    margin-bottom: 0;
}

.status-value {
    font-weight: 500;
    color: #667eea;
}

/* 连接状态 */
.connection-status {
    padding: 12px;
    border-radius: 6px;
    font-size: 14px;
    margin-top: 16px;
    display: none;
}

.connection-status.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.connection-status.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

.connection-status.loading {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
    display: block;
}

/* 通知样式 */
.notification-container {
    position: fixed;
    top: 50px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.notification {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 16px 20px;
    max-width: 350px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: notificationSlideIn 0.3s ease-out;
}

@keyframes notificationSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.notification.success {
    border-left: 4px solid #27ae60;
}

.notification.error {
    border-left: 4px solid #e74c3c;
}

.notification.info {
    border-left: 4px solid #3498db;
}

.notification-icon {
    font-size: 20px;
}

.notification.success .notification-icon {
    color: #27ae60;
}

.notification.error .notification-icon {
    color: #e74c3c;
}

.notification.info .notification-icon {
    color: #3498db;
}

.notification-content {
    flex: 1;
}

.notification-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 2px;
    color: #333;
}

.notification-message {
    font-size: 13px;
    color: #666;
    line-height: 1.3;
}

.notification-close {
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: #999;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.notification-close:hover {
    background: #f5f5f5;
    color: #666;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        width: 250px;
    }
    
    .user-info {
        padding: 16px;
    }
    
    .chat-messages {
        padding: 16px;
    }
    
    .message {
        max-width: 85%;
    }
    
    .modal-content {
        width: 95%;
    }
}

/* 动画效果 */
.fade-in {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.slide-up {
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}